1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package com.google.common.collect;
18
19 import static com.google.common.collect.CollectPreconditions.checkEntryNotNull;
20
21 import com.google.common.annotations.GwtIncompatible;
22
23 import javax.annotation.Nullable;
24
25
26
27
28
29
30
31
32
33 @GwtIncompatible("unnecessary")
34 abstract class ImmutableMapEntry<K, V> extends ImmutableEntry<K, V> {
35 ImmutableMapEntry(K key, V value) {
36 super(key, value);
37 checkEntryNotNull(key, value);
38 }
39
40 ImmutableMapEntry(ImmutableMapEntry<K, V> contents) {
41 super(contents.getKey(), contents.getValue());
42
43 }
44
45 @Nullable
46 abstract ImmutableMapEntry<K, V> getNextInKeyBucket();
47
48 @Nullable
49 abstract ImmutableMapEntry<K, V> getNextInValueBucket();
50
51 static final class TerminalEntry<K, V> extends ImmutableMapEntry<K, V> {
52 TerminalEntry(ImmutableMapEntry<K, V> contents) {
53 super(contents);
54 }
55
56 TerminalEntry(K key, V value) {
57 super(key, value);
58 }
59
60 @Override
61 @Nullable
62 ImmutableMapEntry<K, V> getNextInKeyBucket() {
63 return null;
64 }
65
66 @Override
67 @Nullable
68 ImmutableMapEntry<K, V> getNextInValueBucket() {
69 return null;
70 }
71 }
72 }